import request from '@/utils/request'

const url = '/adminapi/setting/'

// ---------------- 设置 ----------------
/**
 * 上传配置
 * @param {array} data 请求数据
 */
export function uploadConfig(data, method = 'get') {
  if (method === 'post') {
    return request({
      url: url + 'uploadConfig',
      method: 'post',
      data
    })
  } else {
    return request({
      url: url + 'uploadConfig',
      method: 'get',
      params: data
    })
  }
}

/**
 * 支付配置
 * @param {array} data 请求数据
 */
export function paymentConfig(data, method = 'get') {
  if (method === 'post') {
    return request({
      url: url + 'paymentConfig',
      method: 'post',
      data
    })
  } else {
    return request({
      url: url + 'paymentConfig',
      method: 'get',
      params: data
    })
  }
}
